package edu.ubbcs.rs.backend.model.room;

import edu.ubbcs.rs.backend.model.Reservation;
import edu.ubbcs.rs.backend.model.table.Table;
import java.util.Date;
import java.util.List;

/**
 * @author Merli Andras-Bertalan
 * @version 1.0
 * @created 09-jan.-2015 15:37:45
 */
public class WeekdayRoom implements Room {
    
    private final Date date;
    private final Integer hour;
    
    private List<Table> tables;
    private List<Reservation> reservations;

    public WeekdayRoom(Date date, Integer hour) {
        this.date = date;
        this.hour = hour;
    }

    @Override
    public void reserve(Reservation reservation, Table table) {
        reservations.addAll(table.reserve(reservation));
    }

    @Override
    public boolean isReserved(Table table) {
        return table.isReserved(reservations);
    }

    @Override
    public List<Table> getTables() {
        return tables;
    }

    @Override
    public void setTables(List<Table> tables) {
        this.tables = tables;
    }

    @Override
    public List<Reservation> getReservations() {
        return reservations;
    }

    @Override
    public void setReservations(List<Reservation> reservations) {
        this.reservations = reservations;
    }

    @Override
    public Date getDate() {
        return date;
    }

    @Override
    public Integer getHour() {
        return hour;
    }
}
